/**
 * 
 */
package tk.sunlatus.project.usermanage.domain;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import org.apache.commons.lang.builder.ReflectionToStringBuilder;

import tk.sunlatus.project.common.ExtensionInfo;

/**
 * 用户信息类
 * 
 * @author sunlotus
 */
public class User extends ExtensionInfo {

    private String userID = null;

    private String name = null;

    private Integer age = null;

    private int gender = 0;

    private String password = null;

    private int level = 1;

    private int permissionFlag = 0;

    private String infoPwd = null;

    private String tradPwd = null;

    private String verifyInfo = null;

    private AuthInfo authInfo = null;

    private Date expireDate = null;

    private int status = 0;

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public int getPermissionFlag() {
        return permissionFlag;
    }

    public void setPermissionFlag(int permissionFlag) {
        this.permissionFlag = permissionFlag;
    }

    public String getInfoPwd() {
        return infoPwd;
    }

    public void setInfoPwd(String infoPwd) {
        this.infoPwd = infoPwd;
    }

    public String getTradPwd() {
        return tradPwd;
    }

    public void setTradPwd(String tradPwd) {
        this.tradPwd = tradPwd;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    private String salt = null;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public int getGender() {
        return gender;
    }

    public void setGender(int gender) {
        this.gender = gender;
    }

    public User() {
        this.userID = this.toString();
    }

    public User(String userID) {
        setUserID(userID);
    }

    public void setUserID(String userID) {
        this.userID = userID;
    }

    public String getUserID() {
        return userID;
    }

    public String getVerifyInfo() {
        return verifyInfo;
    }

    public void setVerifyInfo(String verifyInfo) {
        this.verifyInfo = verifyInfo;
    }

    @Override
    public String toString() {
        Set<String> exclude = new HashSet<String>();
        exclude.add("password");
        exclude.add("infoPwd");
        exclude.add("tradPwd");
        ReflectionToStringBuilder.toStringExclude(this, exclude);
        return super.toString();
    }

    public AuthInfo getAuthInfo() {
        return authInfo;
    }

    public void setAuthInfo(AuthInfo authInfo) {
        this.authInfo = authInfo;
    }

    /**
     * @return the expireDate
     */
    public Date getExpireDate() {
        return expireDate;
    }

    /**
     * @param expireDate
     *            the expireDate to set
     */
    public void setExpireDate(Date expireDate) {
        this.expireDate = expireDate;
    }

    /**
     * @return the status
     */
    public int getStatus() {
        return status;
    }

    /**
     * @param status
     *            the status to set
     */
    public void setStatus(int status) {
        this.status = status;
    }
}
